//	ID : pallab81
// 	PROG : 10684
// 	LANG : C++
// 	2011-08-28-23.01.17 Sunday
//
// 	"I have not failed, I have just found 10000 ways that won't work.
//


#include <iostream>
#include <algorithm>
#include <vector>
#include <sstream>
#include <fstream>
#include <string>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>

#include <cassert>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <climits>
#include <cstring>
#include <cstdlib>

using namespace std;

#define VI vector< int >
#define CI( x ) scanf("%d",&x)
#define CL( x ) scanf("%lld",&x)
#define CD( x ) scanf("%lf",&x )
#define fo(i,ed) for(int i = 0 ; i < ed ; ++i )
#define foR(i,st,ed) for(int i = st ; i <= ed ; ++i )
#define foit(i, x) for (typeof((x).begin()) i = (x).begin(); i != (x).end(); i++)
#define bip system("pause")
#define Int long long
#define pb push_back
#define SZ(X) (int)(X).size()
#define LN(X) (int)(X).length()
#define mk make_pair
#define f first
#define s second
#define SET( ARRAY , VALUE ) memset( ARRAY , VALUE , sizeof(ARRAY) )

inline void wait( double seconds ){
    double endtime = clock()+( seconds* CLOCKS_PER_SEC );
    while( clock() < endtime ){
        ;
    }
}
int N;
VI w;
inline void Read(){
    w.assign(N+5,0);
    foR(i,1,N){
        CI( w[i] );
    }
}
inline VI Kadane( VI &array ){
    int mS = (int)-1e9; // maximm sum
    int mSI = 0;  // maximum start index
    int mEI = 0;  // maximum end index

    int cmS = 0;  // current maximum sum
    int cSI = 1;  // current start index
    foR(cEI,1,N){
        cmS+= array[ cEI ];
        if( cmS > mS ){
            mS = cmS;
            mSI = cSI;
            mEI = cEI+1;
        }

        if( cmS < 0 ){
            cmS = 0;
            cSI = cEI+1;
        }
    }

    if( mS <= 0 ){
        return VI();
    }
    VI v;
    v.pb(mS);
    v.pb(mSI);
    v.pb(mEI);
return v;
}
inline void Proc(){
    VI vi = Kadane(w);
    if( SZ(vi)<1 ){
        printf("Losing streak.\n");
        return ;
    }
    printf("The maximum winning streak is %d.\n",vi[0]);
}

int main(){
//    #ifndef ONLINE_JUDGE
//        freopen("in.txt","rt",stdin);
//    #endif

    while( scanf("%d",&N)==1 ){
        if( N ==0 )break;
        Read();
        Proc();
    }

return 0;
}
